<!DOCTYPE html>

<html>
<head>
    
    <title>ggg</title>
    <link rel="stylesheet" href="css/test.css">
    
    <!-- <style>
        h2{
            color: blue;
        }
    </style>
    <style>
        h2{
            color:blueviolet;
        }
    </style> -->
</head>
<body>
    <h2 style="color: brown;">gggg</h2>
    <p>hello<q> html</q></p>
    <script>
        // var newValue=oldValue; // 报错：oldValue is not defined
        window.oldValue="ggg"
var newValue=window.oldValue; // 不会报错
console.log(newValue); // undefined
console.log(oldValue);
var num=123;
window.str="string";
// delete num;
// delete str;
console.log(window);
console.log(num); //123
        document.querySelector("body q").addEventListener("click",function(){
            console.log("ceshi");
        });
        document.querySelector("body q").addEventListener("click",function(){
            console.log("ceshi2");
        })
        document.querySelector("body q").onclick=function(){
            console.log("ceshi3");
        }
        document.getElementsByTagName("q")[0].onclick=function(){
            console.log("ceshi4");
        }

        // document.querySelector("body q").removeEventListener("click",function(){
        //     console.log("ceshi2");
        // })
        console.log(document.querySelector("body q").innerHTML); 
        var myNodeList = document.querySelectorAll("p");
        document.head.innerHTML+="<style>body h2{color:blueviolet;}</style>";
       console.log(document.getElementsByTagName("head")[0].outerHTML); ;

        // var els=document.getElementsByTagName("h2");
        // for(var i=0;i<els.length;i++){
        //     els[i].style.color="green"

        // }
        
        // var s1 = "qpzm";

        // var s2 = "qp" + "zm";



        // if (s1 == s2) {

        //     document.write("s1 == s2 return true");

        // } else {

        //     document.write("s1 == s2 return false");

        // }

        // if (s1.equals(s2)) {

        //     document.write("s1.equals(s2) return true");

        // } else {

        //     document.write("s1.equals(s2) return false");

        // }
    </script>
    <noscript>抱歉，你的浏览器不支持 JavaScript!</noscript>
</body>

</html>